package com.cote.douhahou.pretloan.setting;

import android.os.Bundle;
import android.view.WindowManager;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.cote.douhahou.pretloan.service.CusServiceAkomapalendDialog;
import com.cote.douhahou.pretloan.network.HttpHelper;
import com.cote.douhahou.pretloan.utils.AkomapaLendConfigs;
import com.cote.douhahou.pretloan.R;

public class LogoutActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_log_out);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);

        findViewById(R.id.asa_ib_back).setOnClickListener(v -> onBackPressed());
        findViewById(R.id.asa_ib_customer_service).setOnClickListener(v -> new CusServiceAkomapalendDialog(this).show());

        TextView versionTv = findViewById(R.id.asa_tv_version);
        versionTv.setText(getString(R.string.setting_version, AkomapaLendConfigs.AkomapalendVERSIONNAME));
        findViewById(R.id.asa_btn_logout).setOnClickListener(v -> {
            HttpHelper.inst().submitEvent("SETTING","LOGOUT_CLICK","");
            new LogAkomapalendoutDialog(this).show();
        });

    }


    @Override
    protected void onResume() {
        super.onResume();
        HttpHelper.inst().submitEvent("SETTING","START","");
    }

    @Override
    protected void onPause() {
        super.onPause();
        HttpHelper.inst().submitEvent("SETTING","END","");
    }

}